import { Controller } from 'egg';
import { Result } from '../util/result';

export default class SysController extends Controller {
  /**
   * 查询企业库的医疗领域列表
   */
  public async medicalList() {
    const { ctx } = this;
    const list = await ctx.service.sys.medicalList();
    ctx.body = new Result({ list });
  }

  /**
 * 查询企业库的企业类别列表
 */
  public async companyTypeList() {
    const { ctx } = this;
    const list = await ctx.service.sys.companyTypeList();
    ctx.body = new Result({ list });
  }

  /**
  * 查询企业库的主营方向列表
  */
  public async mainBusinessList() {
    const { ctx } = this;
    const list = await ctx.service.sys.mainBusinessList();
    ctx.body = new Result({ list });
  }

  /**
* 查询企业库的所有可选列表
*/
  public async optionList() {
    const { ctx } = this;
    const {
      medicalOptionList,
      typeList,
      businessOptionList
    } = await ctx.service.sys.optionList();
    ctx.body = new Result({
      medicalOptionList,
      typeList,
      businessOptionList
    });
  }
}
